#!/usr/bin/env bash

set -e -u -o pipefail
if [[ -n "${DEBUG-}" ]]; then
    set -x
fi

if [[ ${BUILDKITE_AGENT_META_DATA_OS} == darwin* ]]; then
    ./ci/cleanup.sh
elif [[ ${BUILDKITE_AGENT_META_DATA_OS} == linux* ]]; then
    echo "Running a linux agent, no need for any cleanup."
    exit 0
else
    powershell -noprofile -noninteractive -file "./ci/cleanup.ps1"
fi
